package com.tyk.bookstore.front.cart.model.vo;


import com.tyk.bookstore.front.common.core.util.FileUtil;
import com.tyk.bookstore.front.product.model.enume.BookState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
/**
 * @author tyk
 * @description 购物车
 */
@Data
public class ShoppingCartVo {
    @Schema(description = "书籍ID")
    private Long bookId;
    @Schema(description = "购买数量")
    private Integer num;
    @Schema(description = "选中")
    private Boolean checked;
    @Schema(description = "书籍封面")
    private String cover;
    @Schema(description = "书籍标题")
    private String title;
    @Schema(description = "书籍价格")
    private BigDecimal price;
    @Schema(description = "书籍状态")
    private BookState state;

    public ShoppingCartVo setCover(String cover) {
        this.cover = FileUtil.fullFilePath(cover);
        return this;
    }
}
